﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Windows;
using Caliburn.PresentationFramework.ApplicationModel;
using StockTraderRI.Infrastructure.Presenters;
using Caliburn.Core;
using Microsoft.Practices.Composite.Events;

namespace StockTraderRI
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App : CaliburnApplication
    {


        protected override Microsoft.Practices.ServiceLocation.IServiceLocator CreateContainer()
        {
            var container = base.CreateContainer() as SimpleContainer;
            container.RegisterSingleton<IEventAggregator, EventAggregator>();
            container.RegisterSingleton<Infrastructure.Interfaces.IMarketFeedService, Stub.MarketFeedServiceStub>();
			
            return container;
        }
 

        protected override System.Reflection.Assembly[] SelectAssemblies()
        {
            return base.SelectAssemblies()
                .Union(
                    new[] {
                        typeof(Modules.Position.PositionModule).Assembly
                    }
                ).ToArray();
        }

        protected override void ConfigurePresentationFramework(Caliburn.PresentationFramework.PresentationFrameworkModule module)
        {
            module.UsingViewStrategy<Infrastructure.StockTraderViewStrategy>();
			//module.UsingBinder<Infrastructure.StockTraderBinder>();
        }
        protected override object CreateRootModel()
        {
            return Container.GetInstance<IShellPresenter>();
        }


    }
}
